package com.xbongbong.saas.domain.dao;

import com.xbongbong.pro.knowledge.base.pojo.KnowledgeBaseCountPojo;
import com.xbongbong.saas.domain.entity.KnowledgeDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 知识DAO
 *
 * @author ruansicheng
 */
@Mapper
@Repository
public interface KnowledgeDataDao {
    Integer insert(KnowledgeDataEntity entity);

    void insertBatch(List<KnowledgeDataEntity> list);

    KnowledgeDataEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(KnowledgeDataEntity entity);

    List<KnowledgeDataEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    Integer updateBatch(@Param("list") List<KnowledgeDataEntity> knowledgeDataEntities, @Param("corpid") String corpid);

    List<KnowledgeBaseCountPojo> getCountByKnowledgeId(@Param("corpid") String corpid,@Param("idList") List<Long> idList);

    Integer deleteByCorpIdKnowledgeId(@Param("corpid") String corpid ,@Param("idList") List<Long> idList);

    List<Long> getIdListByCorpId(@Param("corpid") String corpid, @Param("idList") List<Long> knowledgeList);

    List<String> getCorpidList();
}
